const fileRouter = require('./routers/fileRouter');
const productRouter = require('./routers/productRouter');
const serviceTeamRouter = require('./routers/serviceTeamRouter');
const serviceAgencyRouter = require('./routers/serviceAgencyRouter');
const questionnaireRouter = require('./routers/questionnaireRouter');
const loginRouter = require('./routers/loginRouter');
const homeRouter = require('./routers/homeRouter');
const errorRouter = require('./routers/errorRouter');

const bodyParser = require('body-parser');
const express = require('express');
const app = express();


app.all('*', (req, res, next) => {
  res.header('Access-Control-Allow-Origin', '*');
  next();
})

app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use(fileRouter);
app.use(productRouter);
app.use(serviceTeamRouter);
app.use(serviceAgencyRouter);
app.use(questionnaireRouter);
app.use(homeRouter);
app.use(loginRouter);
app.use(errorRouter);


app.listen(3030);

console.log('Server runing at http://localhost:3030/');
